package com.sskj.functions.presenter;


import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.functions.activity.CurrentTreasureActivity;
import com.sskj.lib.bean.CurrentTreasureBean;
import com.sskj.lib.bean.CurrentTypeBean;
import com.sskj.lib.http.JsonCallBack;

import java.util.List;

/**
 * @author Hey
 * Create at  2019/06/25
 */
public class CurrentTreasurePresenter extends BasePresenter<CurrentTreasureActivity> {
    public void getCurrentTreasureData(String type, String language) {
        httpService.getCurrentTreasureData(type, language)
                .tag(this)
                .execute(new JsonCallBack<HttpData<CurrentTreasureBean>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<CurrentTreasureBean>> response) {
                        mView.getCurrentTreasureData(response.body().getData());
                    }
                });
    }

    public void getCoinList() {
        httpService.getCoinList()
                .tag(this)
                .execute(new JsonCallBack<HttpData<List<String>>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<List<String>>> response) {
                        mView.getCoinListOK(response.body().getData());
                    }
                });
    }
}
